package cn.wolfcode._IOday01_.synthesizeWork02;

import java.io.*;

public class Demo3 {
    public static void main(String[] args) throws IOException {
        FileInputStream inputStream = new FileInputStream(new File("666.txt"));
        int len ;
        byte[] b = new byte[100];
        String str = null ;
        while((len=inputStream.read(b)) != -1){
           str = new String(b,0,len);
        }
        String[] arr = str.split(";");
        Student[] students = new Student[arr.length];
        for (int i = 0; i < arr.length; i++) {
            String[] split = arr[i].split("-");
            int k = Integer.valueOf(split[1]);
            double d = Double.valueOf(split[2]);
            students[i] = new Student(split[0],k,d);
        }
        int sum = 0 ;
        for (Student s :students){
            sum += s.getScore();
            System.out.println(s);
        }
        System.out.println("总分="+sum);
        String v = "585" ;
        //Integer v1 = Integer.valueOf(v);
        //int v2 = Integer.valueOf(v1);
        //Integer v3 = Integer.valueOf(v2);
        //String v4 = v3.toString();
        //int v5 = Integer.parseInt(v4);
        //String v6 = Integer.toString(v5);
    }
}
